package com.superman.supermarket.client.widget.button;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.superman.mvpframe.client.gin.XGinjector;

/**
 * 返回按钮
 * 
 * @author superman
 * @version 2018年8月13日下午10:23:14
 */
public class BackButton extends HTML {

	/**
	 * 构造方法
	 * 
	 * @author superman
	 * @version 2018年8月13日 下午10:23:30
	 */
	public BackButton() {
		this.addStyleName("fa fa-angle-left fa-lg");
		this.getElement().getStyle().setProperty("width", "1.2rem");
		this.getElement().getStyle().setProperty("height", "1.2rem");
		this.getElement().getStyle().setProperty("lineHeight", "1.2rem");
		this.getElement().getStyle().setProperty("color", "#666");
		this.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				XGinjector.INSTANCE.getMyPlaceController().back();
			}
		});
	}
}
